import { createWebHashHistory, createRouter } from "vue-router";
import dynamicRoutes from "./dynamic-route";
import Layout from "@/layout/Layout.vue";

const routes = [
  {
    path: "/",
    redirect: "/welcome",
    component: Layout,
    children: [
      {
        path: "/welcome",
        name: 'Welcome',
        meta: {
          title: '控制台'
        },
        component: () => import("@/views/Welcome/index.vue"),
      },
    ],
  },
  ...dynamicRoutes,
];

const router = createRouter({
  history: createWebHashHistory("./"),
  routes,
});

export default router;
